package com.ebupt.migu.music.common.util;


import com.ebupt.migu.music.schedule.service.MessageNoticeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Map;

/**
 * @Description TODO
 * @Author liuyangyang@cd.ebupt.com
 * @Date 2020/8/12 23:04
 */
@Slf4j
@Service
@Component
public class FileRecordAsync {

    @Autowired
    private MessageNoticeService messageNoticeService;

    public static FileRecordAsync fileRecordAsync;


    @PostConstruct
    public void init() {
        fileRecordAsync = this;
    }

    /**
     * 发送记录
     *
     * @param uids
     * @param taskID
     */
    @Async("message_notice_executor")
    public void record(List<String> uids, Map<String, Object> strategy, String taskID) {
        messageNoticeService.cons_send_message(uids, strategy, taskID);
    }


}
